{extend name="layout/layout" /}

{block name="pagecss"}
<style>
    .district {
        cursor: pointer;
    }
</style>
{/block}

{block name="content"}
<div class="row js-check-wrap">
    <div class="col-md-12">
        <div class="advanced-search">
            <div class="portlet box green" id="advancedSearch" data-model="agent">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-search"></i> 高级搜索 </div>
                <div class="tools">
                    <a href="javascript:;" class="expand" title="展开/收缩"> </a>
                </div>
            </div>
            <div class="portlet-body form" style="display: none;">
                <!-- BEGIN FORM-->
                <form id="search" action="" class="form-horizontal">
                    <div class="form-body">
                        <!--<h3 class="form-section"></h3>-->
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-md-3">代理商账号</label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" name="name" value="">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-md-3">代理级别</label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="levelId">
                                            <option value="">所有</option>
                                            {foreach name="agentLevel" item="level" key="levelKey"}
                                            <option value="{$level.id}">{$level.levelName}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-md-3">所在地区</label>
                                    <div class="col-md-9">
                                        <!--<select class="form-control select2-multiple" name="district" multiple>
                                            <optgroup label="湖北">
                                                <option value="武汉">武汉</option>
                                                <option value="黄石">黄石</option>
                                                <option value="宜昌">宜昌</option>
                                            </optgroup>
                                            <optgroup label="湖南">
                                                <option value="长沙">长沙</option>
                                                <option value="岳阳">岳阳</option>
                                            </optgroup>
                                        </select>-->
                                        <input type="text" class="form-control district" name="district" value="" readonly>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-md-3">充值金额</label>
                                    <div class="col-md-9">
                                        <div class="input-group">
                                            <input type="number" class="form-control" name="start_amount">
                                            <span class="input-group-addon"> 至 </span>
                                            <input type="number" class="form-control" name="end_amount">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-md-3">联系人</label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" name="contactUser" value="">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="control-label col-md-3">手机号</label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" name="phone" value="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="row">
                                    <div class="col-md-offset-3 col-md-9">
                                        <button type="button" class="btn green" id="doSearch">搜索</button>
                                        <button type="reset" class="btn default">清空</button>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6"> </div>
                        </div>
                    </div>
                </form>
                <!-- END FORM-->
            </div>
        </div>
        </div>

        <div class="portlet light">
            <div class="box-header">
                <div class="row">
                    <div class="col-md-9 col-sm-12">
                        <!--<form id="searchForm" class="form">
                            <div class="row" id="search">
                                <div class="col-md-2">
                                    <select name="name" class="form-control ">
                                        <option value="">所有</option>
                                    </select>
                                </div>
                                <div class="col-md-1">
                                    <button type="button" class="btn btn-success" id="doSearch" title="搜索">
                                        <i class="fa fa-search"></i> 搜索
                                    </button>
                                </div>
                            </div>
                        </form>-->
                    </div>
                    <div class="col-md-3 col-sm-12">
                        <div class="pull-right">
                            {if condition="($ifAdd)"}
                            <a href="{:url('agent/agent/add')}" class="btn blue btn-circle"><i class="fa fa-plus"></i> 新增代理商</a>
                            {/if}
                        </div>
                    </div>
                </div>
            </div>
            <div class="portlet-body">
                <form class="js-ajax-form" method="post">
                    <div class="">
                        <table id="data-table" class="table table-bordered table-hover dataTable">
                            <thead>
                            <th>代理商名称</th>
                            <th>代理级别</th>
                            <th>所地区</th>
                            <th>充值金额</th>
                            <!--<th>剩余套数</th>-->
                            <th>联系人</th>
                            <th>手机号</th>
                            <th>创建时间</th>
                            <th>操作</th>
                            </thead>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="datalist_url" value="{:url('agent/agent/ajaxAgentList')}">
<input type="hidden" class="view_url" value="{:url('agent/agent/view')}">
<input type="hidden" class="edit_url" value="{:url('agent/agent/edit')}">
<input type="hidden" class="recharge_url" value="{:url('agent/agent/recharge')}">
<input type="hidden" class="delete_url" value="{:url('agent/agent/delete')}">
<input type="hidden" class="district_url" value="{:url('agent/region/getDistrict')}">
{/block}

{block name="pagescript"}
<script src="__STATIC__/agent/pages/js/agent.js" type="text/javascript"></script>
{/block}